package dz.chuxin.framework.widget.rowview;

import android.content.Context;
import android.util.AttributeSet;
import android.widget.LinearLayout;

/**
 * Created by chuxin on 2016/7/17.
 */
public class RowGroupContainerView extends LinearLayout {

    private Context mContext;

    public RowGroupContainerView(Context context) {
        this(context, null);
    }

    public RowGroupContainerView(Context context, AttributeSet attrs) {
        this(context, attrs, 0);
    }

    public RowGroupContainerView(Context context, AttributeSet attrs, int defStyleAttr) {
        super(context, attrs, defStyleAttr);
        mContext = context;
        setOrientation(VERTICAL);
    }

    public void stuffData(OnRowClickListener listener, RowViewGroupDescriptor... groupDescriptors) {
        for (RowViewGroupDescriptor groupDescriptor : groupDescriptors) {
            RowGroupView rowGroupView = new RowGroupView(mContext);
            rowGroupView.stuffData(groupDescriptor, listener);
            addView(rowGroupView);
        }
    }
}
